package com.example.liumuyao.zyfypt_412lmy.activity;

import android.Manifest;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.liumuyao.zyfypt_412lmy.R;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private TextView username,userpass;
    private EditText name,pass;
    private Button Blg,Brg;
    private ImageView IM;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        init();
    }

    private void init() {
        //获取控件
        username = (TextView)findViewById(R.id.textView);
        userpass = (TextView)findViewById(R.id.textView2);
        IM = (ImageView)findViewById(R.id.imageView2);
        Blg = (Button)findViewById(R.id.button);
        Brg = (Button)findViewById(R.id.button2);
        name = (EditText)findViewById(R.id.editText);
        pass = (EditText)findViewById(R.id.editText3);

        //设置按钮监听器
        Blg.setOnClickListener(this);
        Brg.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.button2:
                Intent intent = new Intent(MainActivity.this,Main2Activity.class);
                startActivity(intent);
                break;
            case R.id.button:
                Intent intent1 = new Intent(MainActivity.this,RegisterActivity.class);
                startActivity(intent1);
                break;
        }
    }
}
